'''
An example of mixing handlers.


@author: Hatem Oraby
'''
import twistedSim.simManager as simManager 
from twistedSim.moduleHandler import asyncoreH,twistedH

def main():
    machine = simManager.Machine()

    #Module 1: Time Server
    timeServer = simManager.Module('asyncServer', handler = asyncoreH())
    simManager.SimManager.addModule(timeServer, machine)
    
    #Module 2: Client 
    timeClient = simManager.Module('twistedClient', startTime = 60,
                                     handler = twistedH())
    simManager.SimManager.addModule(timeClient, machine)
    
    simManager.SimManager.run()

if __name__ == '__main__':
    main()